package com.iona.domain;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class StudyWork extends BaseEntity {

	private String name;
	private Integer countOfHours;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "typestudywork_fk")
	private TypeStudyWork typeStudyWork;

	@OneToMany
	@JoinColumn(name = "studywork_fk")
	private List<PartDisStudyWork> partdisList;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getCountOfHours() {
		return countOfHours;
	}

	public void setCountOfHours(Integer countOfHours) {
		this.countOfHours = countOfHours;
	}

	public TypeStudyWork getTypeStudyWork() {
		return typeStudyWork;
	}

	public void setTypeStudyWork(TypeStudyWork typeStudyWork) {
		this.typeStudyWork = typeStudyWork;
	}

	public List<PartDisStudyWork> getPartdisList() {
		if(partdisList == null){
		partdisList = createList();
		}
		return partdisList;
	}

	public void setPartdisList(List<PartDisStudyWork> partdisList) {
		this.partdisList = partdisList;
	}

	

}
